'use strict';
function rank_by_two_large_one_small(collection){
  function sortnumber(a,b){
    return a-b;
  }
  collection.sort(sortnumber);
  for(let i=0;i<collection.length-3;i=i+3){
    let temp=collection[i];
    collection[i]=collection[i+1];
    collection[i+1]=collection[i+2];
    collection[i+2]=temp;
  }
  return collection;
}
module.exports = rank_by_two_large_one_small;
